3330. 找到初始输入字符串 I
class Solution {
    public:
        int possibleStringCount(string word) 
        {
            if(word.size()<2)
            {
                return 1;
            }
            int repeatbegin = 0;
            int repeatend = 0;
            int ans=1;
    
            while(repeatend < word.size())
            {
                if(word[repeatbegin]!=word[repeatend]) 
                {
                    ans += repeatend - repeatbegin - 1;
                    repeatbegin=repeatend;
                }
                repeatend++;
            }
            ans += repeatend - repeatbegin -1;
            return ans;
        }
    };

238. 除自身以外数组的乘积
class Solution {
    public:
        vector<int> productExceptSelf(vector<int>& nums) 
        {
            int n = nums.size();
            vector<int> prefix(n,1);
            vector<int> suffix(n,1);
    
            for(int i=1;i<n;i++)
            {
                prefix[i]=nums[i-1]*prefix[i-1];
            }
    
            for(int i=n-2;i>=0;i--)
            {
                suffix[i]=nums[i+1]*suffix[i+1];
            }
    
            vector<int> ret(n,0);
            for(int i=0;i<n;i++)
            {
                ret[i]=prefix[i]*suffix[i];
            }
    
            return ret;
        }
    
    
    };